package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.GoodsFollowMapper;
import com.ruoyi.shop.domain.GoodsFollow;
import com.ruoyi.shop.service.IGoodsFollowService;

/**
 * 商品关注Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-11
 */
@Service
public class GoodsFollowServiceImpl implements IGoodsFollowService 
{
    @Autowired
    private GoodsFollowMapper goodsFollowMapper;

    /**
     * 查询商品关注
     * 
     * @param id 商品关注主键
     * @return 商品关注
     */
    @Override
    public GoodsFollow selectGoodsFollowById(Long id)
    {
        return goodsFollowMapper.selectGoodsFollowById(id);
    }

    /**
     * 查询商品关注列表
     * 
     * @param goodsFollow 商品关注
     * @return 商品关注
     */
    @Override
    public List<GoodsFollow> selectGoodsFollowList(GoodsFollow goodsFollow)
    {
        return goodsFollowMapper.selectGoodsFollowList(goodsFollow);
    }

    /**
     * 新增商品关注
     * 
     * @param goodsFollow 商品关注
     * @return 结果
     */
    @Override
    public int insertGoodsFollow(GoodsFollow goodsFollow)
    {
        goodsFollow.setCreateTime(DateUtils.getNowDate());
        return goodsFollowMapper.insertGoodsFollow(goodsFollow);
    }

    /**
     * 修改商品关注
     * 
     * @param goodsFollow 商品关注
     * @return 结果
     */
    @Override
    public int updateGoodsFollow(GoodsFollow goodsFollow)
    {
        goodsFollow.setUpdateTime(DateUtils.getNowDate());
        return goodsFollowMapper.updateGoodsFollow(goodsFollow);
    }

    /**
     * 批量删除商品关注
     * 
     * @param ids 需要删除的商品关注主键
     * @return 结果
     */
    @Override
    public int deleteGoodsFollowByIds(Long[] ids)
    {
        return goodsFollowMapper.deleteGoodsFollowByIds(ids);
    }

    /**
     * 删除商品关注信息
     * 
     * @param id 商品关注主键
     * @return 结果
     */
    @Override
    public int deleteGoodsFollowById(Long id)
    {
        return goodsFollowMapper.deleteGoodsFollowById(id);
    }
}
